xen: fix generated code for calling hypercall handlers
authorJuergen Gross <jgross@suse.com>
Fri, 4 Nov 2022 07:54:57 +0000 (08:54 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 4 Nov 2022 07:54:57 +0000 (08:54 +0100)
commit9f3e585ff5ecc606e386057f5cfa66b22fea2b93
tree04c2a4e7023a886d217cd46fde011ea514d49ad1
parent8e35b1a98d8d789aa428eae9ea8b64018af469c3
xen: fix generated code for calling hypercall handlers

The code generated for the call_handlers_*() macros needs to avoid
undefined behavior when multiple handlers share the same priority.
The issue is the hypercall number being unverified fed into the macros
and then used to set a mask via "mask = 1ULL << <hypercall-number>".

Avoid a shift amount of more than 63 by setting mask to zero in case
the hypercall number is too large.

Fixes: eca1f00d0227 ("xen: generate hypercall interface related code")
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Henry Wang <Henry.Wang@arm.com>
xen/scripts/gen_hypercall.awk